package com.hmall.order.job;

import com.hmall.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyTask {

    @Autowired
    private IOrderService orderService;

    /**
     * 每一分钟自行一次
     */
    @Scheduled(cron = "0 * * * * *")
    public void executeTask(){
        orderService.deleteOverTime();
    }
}
